package com.xzq.busgstack.client;

import com.xzq.busgstack.codec.ObjDecoder;
import com.xzq.busgstack.codec.ObjEncoder;
import com.xzq.busgstack.domain.MsgInfo;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * @Author xzq
 * @Description //TODO
 * @Date 2021/11/20 14:46
 * @Version 1.0.0
 **/
public class MyChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ch.pipeline().addLast(new ObjDecoder(MsgInfo.class));
        ch.pipeline().addLast(new ObjEncoder(MsgInfo.class));
        ch.pipeline().addLast(new MyClientHandler());
    }
}
